package com.chy.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.chy.entity.User;
import com.chy.entity.UserAllInfo;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface UserMapper extends BaseMapper<User>{


//    @SuppressWarnings("MybatisXMapperMethodInspection")
    @MapKey("id")
    List<Map<String, Object>> selectRepeatUsers(@Param(value = "params") Map<String, Object> params);


    @Select("select * from user where name = #{name} or email = #{email}")
    List<User> selectUsers(User user);

    IPage<UserAllInfo> selectMyPage(IPage<User> page, @Param(Constants.WRAPPER) Wrapper<User> queryWrapper);

    boolean insertUser(@Param(value = "params") Map<String, Object> params);
    boolean updateUser(@Param(value = "params") Map<String, Object> params);

}
